package com.googlecode.likesql.utils;

import java.io.IOException;
import java.util.Properties;

/**
 * This class is to manipulate properties file and {@link Properties} objects.
 * 
 * @author Johny Huang
 * @since 0.1
 * @see {@link Properties}
 * @see {@link ClassLoader}
 *
 */
public final class PropertiesUtils {

	/**
	 * Load the specify properties file in the current ClassLoader to Properties.
	 * 
	 * @param propName full path and name of the properties file
	 * @return
	 */
	public static Properties load(String propName){
		ClassLoader cl=PropertiesUtils.class.getClassLoader();
		Properties prop=new Properties();
		try {
			prop.load(cl.getResourceAsStream(propName));
		} catch (IOException e) {
			e.printStackTrace();
		}
		return prop;
	}
	
	private PropertiesUtils(){
		
	}
}
